home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
mhs_c.arc
/
OUTPOST.ARC
/
NDT.H
< prev
next >
Wrap
C/C++ Source or Header
|
1988-06-27
|
6KB
|
224 lines
#ifdef LC215
#ifndef void
#define void int
#endif
#ifndef BYTE
#define BYTE char
#endif
#ifndef WORD
#define WORD unsigned
#endif
#ifndef NULL
#ifdef SPTR
#define NULL 0
#else
#define NULL 0L
#endif
#endif
#endif
#ifdef LC300
#ifndef BIG_MEMORY
#define BIG_MEMORY
#ifndef NARGS
#define PROTOTYPE
#endif
#endif
#ifndef BYTE
#define BYTE unsigned char
#endif
#ifndef WORD
#define WORD unsigned short
#endif
#ifndef NULL
#ifdef SPTR
#define NULL 0
#else
#define NULL 0L
#endif
#endif
#endif
/*
if running TURBO 'C' pretend to be Microsoft with prototypes.
Must replace "func(char *, )" with "func(char *, ...)". In order
to do this we use _ELIPSIS_ as a place holder for the variable args.
*/
#ifndef _ELIPSIS_
#ifdef __TURBOC__
#define MSC
#define LINT_ARGS
#define _ELIPSIS_ ...
#else
#define _ELIPSIS_
#endif
#endif
#ifdef MSC
#ifndef BIG_MEMORY
#define BIG_MEMORY
#ifdef LINT_ARGS
#define PROTOTYPE
#endif
#endif
#ifndef BYTE
#define BYTE unsigned char
#endif
#ifndef WORD
#define WORD unsigned short
#endif
#ifndef O_RAW
#define O_RAW O_BINARY
#endif
#ifndef setmem
#define setmem(dest, cnt, c) memset((dest),(c),(cnt))
#endif
#ifndef movmem
#define movmem(src, dest, cnt) memcpy((dest), (src), (cnt))
#endif
#ifndef strbrk
#define strbrk(s1, s2) strpbrk((s1), (s2))
#endif
#ifndef NPrintF
#define NPrintF printf
#endif
#ifndef NULL
#if defined(M_I86LM) || defined(M_I86CM) || defined(M_I86HM)
#define NULL 0L
#else
#define NULL 0
#endif
#endif
#ifndef Free
#define Free(p) (free(p), 0)
#endif
#endif
#ifdef AZTEC
#ifndef BIG_MEMORY
#define BIG_MEMORY
#endif
#ifndef BYTE
#define BYTE unsigned char
#endif
#ifndef WORD
#define WORD unsigned short
#endif
#ifndef NULL
#if sizeof(char *) == 2
#define NULL 0
#else
#define NULL 0L
#endif
#endif
#ifndef O_RAW
#define O_RAW 0
#endif
#endif
#ifndef NOPROC
#define NOPROC ((int (*)())0)
#endif
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
/**** This defines the data structure returned by FindFirst/FindNext calls ****/
typedef struct
{
/* The first 21 bytes are officially undefined, but the following defini-
tion is that used if the search is done on a network drive */
char uniqueID; /* if 0x5a, route search to network */
char searchMode; /* 0 = regular file search with no
subdirectories.
1 = in regular file search, later
add subdirectories.
2 = searching subdirectories
3 = search is done. */
int searchCount; /* Sequence number for searches */
char directoryHandle; /* Handle of directory being searched*/
char searchAttribute; /* Attribute used in search */
char searchPatternLength; /* Length of the search pattern */
char searchPattern[13]; /* File pattern being searched for */
char server; /* Server being searched */
/* The following bytes are well defined for both DOS and the network */
BYTE attributeFound; /* Attribute of matching file */
unsigned fileTime; /* Time stamp of file */
unsigned fileDate; /* Date stamp of file */
long fileSize; /* Size of file in bytes */
char fileName[13]; /* Name of matching file */
} FILEINFO;
/* File Attributes */
#ifndef FA_READ_ONLY
#define FA_NORMAL ((BYTE)0x00)
#define FA_READ_ONLY ((BYTE)0x01)
#define FA_HIDDEN ((BYTE)0x02)
#define FA_SYSTEM ((BYTE)0x04)
#define FA_EXECUTE_ONLY ((BYTE)0x08)
#define FA_DIRECTORY ((BYTE)0x10)
#define FA_NEEDS_ARCHIVED ((BYTE)0x20)
#define FA_SHAREABLE ((BYTE)0x80)
/* Extended file attributes */
#define FA_TRANSACTIONAL ((BYTE)0x10)
#define FA_INDEXING ((BYTE)0x20)
#define FA_AUDIT_READ ((BYTE)0x40)
#define FA_AUDIT_WRITE ((BYTE)0x80)
#endif
/* File Open Modes */
/* Inheritance flag */
#define IF_INHERITED (BYTE)0x00
#define IF_PRIVATE (BYTE)0x80
/* Sharing modes */
#define SM_COMPATIBILITY (BYTE)0x00
#define SM_DENY_READ_WRITE (BYTE)0x10
#define SM_DENY_WRITE (BYTE)0x20
#define SM_DENY_READ (BYTE)0x30
#define SM_DENY_NONE (BYTE)0x40
/* Access modes */
#define AM_READ (BYTE)0x00
#define AM_WRITE (BYTE)0x01
#define AM_READ_WRITE (BYTE)0x02
/* DOS errors */
#define DOS_INVALID_FUNCTION_NUMBER 1
#define DOS_FILE_NOT_FOUND 2
#define DOS_PATH_NOT_FOUND 3
#define DOS_TOO_MANY_OPEN_FILES 4
#define DOS_ACCESS_DENIED 5
#define DOS_INVALID_FILE_HANDLE 6
#define DOS_MEMORY_BLOCKS_DESTROYED 7
#define DOS_INSUFFICIENT_MEMORY 8
#define DOS_INVALID_MEMORY_BLOCK_ADDR 9
#define DOS_INVALID_ENVIRONMENT 10
#define DOS_INVALID_FORMAT 11
#define DOS_INVALID_ACCESS_CODE 12
#define DOS_INVALID_DATA 13
#define DOS_INVALID_DRIVE_SPECIFIED 15
#define DOS_ATTEMPT_TO_DEL_CURRENT_DIR 16
#define DOS_NOT_SAVE_DEVICE 17
#define DOS_NO_MORE_FILES 18
extern BYTE DOSError; /* Used to return DOS Errors from INT 21 calls */
#ifdef BIG_MEMORY
#ifdef PROTOTYPE
extern int FindFirstFile(char *, FILEINFO *, char);
extern int FindNextFile(FILEINFO *);
#else
extern int FindFirstFile();
extern int FindNextFile();
#endif